package com.huida.app.java8;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author wangzhuangzhuang
 * @DESC:
 * @date 2022-01-02 22:13
 */
public class FilterListByAnotherList {
	public static void main(String[] args) {
		List<String> list01 = Arrays.asList("1", "2", "3");
		List<String> list02 = Arrays.asList("1");
		List<String> filteredList = list01.stream().filter(e -> !list02.contains(e))
				.collect(Collectors.toList());
		System.out.println(filteredList); // [2, 3]
	}
}